stage-snap causes issues when mixing cores
Metadata
Current evaluation
No evaluation has been recorded for this issue yet.
Issue body
I came across this issue whilst trying to stage a core16 snap into a core18.
It seems that, when mixing these cores, your build environment (during snapcraft build) is overwritten by the unpacking of the incoming stage snap. This obviously breaks build packages that you have. E.g. this yaml https://www.irccloud.com/pastebin/mxelP3CN/ gives errors like:
```
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
```
```
fatal: unable to find remote helper for 'https
```
Even if you put this stage snap to the bottom of the build process, you will end up with an error like:
```
Failed to stage: Parts 'aws-cli' and 'docker' have the following files, but with different contents:
etc/mime.types
lib/x86_64-linux-gnu/libexpat.so.1
usr/bin/pdb3
usr/bin/py3clean
usr/bin/py3compile
usr/bin/pydoc3
usr/bin/pygettext3
usr/bin/python3
usr/bin/python3m
usr/bin/run-mailcap
usr/lib/valgrind/python3.supp
usr/lib/x86_64-linux-gnu/libexpatw.so.1
usr/lib/x86_64-linux-gnu/libffi.so.6.0.4
usr/lib/x86_64-linux-gnu/libmpdec.so.2.4.2
usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6
usr/share/doc/libexpat1/changelog.Debian.gz
usr/share/doc/libexpat1/copyright
usr/share/doc/libffi6/changelog.Debian.gz
usr/share/doc/libmpdec2/changelog.Debian.gz
usr/share/doc/libpython3-stdlib/README.Debian
usr/share/doc/libpython3-stdlib/changelog.Debian.gz
usr/share/doc/libsqlite3-0/changelog.Debian.gz
usr/share/doc/mime-support/changelog.gz
usr/share/doc/python3-minimal/README.Debian
usr/share/doc/python3-minimal/changelog.Debian.gz
usr/share/man/man1/pdb3.1.gz
usr/share/man/man1/pydoc3.1.gz
usr/share/man/man1/pygettext3.1.gz
usr/share/man/man1/python3.1.gz
usr/share/man/man1/python3m.1.gz
usr/share/man/man1/run-mailcap.1.gz
usr/share/pixmaps/python3.xpm
usr/share/python3/debian_defaults
usr/share/python3/debpython/version.py
usr/share/python3/py3versions.py
Snapcraft offers some capabilities to solve this by use of the following keywords:
- `filesets`
- `stage`
- `snap`
- `organize`
To learn more about these part keywords, run `snapcraft help plugins`.
```
I propose that snapcraft gives a warning when pulling in the snap to be staged if the cores mismatch.
Evaluation history
No evaluation history available.